<template>
	<view class="privacy">
		<view class="rect border-box p-20" @tap.stop>
			<view class="f-15 bold text-center m-b-10">用户协议和隐私政策</view>
			<view class="f-base m-b-10">
				在您使用轻松小镇APP的过程中，您需要通过点击同意的形式在线签署
				<text class="link" @click="toProtocol">《用户协议》</text>和<text class="link" @click="toPrivacy">《隐私政策》</text>，请您务必仔细阅读、充分理解协议中的条款内容再点击同意。
			</view>
			<view class="flex-no-horizontal btn-group f-15">
				<text style="color: #999999;" @click="refuse">不同意</text>
				<text @click="agree">同意</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		methods: {
			refuse() {
				// #ifdef APP-PLUS
					plus.runtime.disagreePrivacy()
					if (uni.getSystemInfoSync().platform === 'ios') {
						plus.ios.import('UIApplication').sharedApplication().performSelector('exit');
					} else {
						plus.runtime.quit()
					}
				// #endif
			},
			agree() {
				// #ifdef APP-PLUS
					plus.runtime.agreePrivacy()
					uni.reLaunch({
						url: '../ring/index'
					})
				// #endif
			},
			toProtocol () {
				uni.navigateTo({
					url: '../collection/otherPage?url=http://api.relaverse.cn/index/Html/individually?id=3'
				})
			},
			toPrivacy () {
				uni.navigateTo({
					url: '../collection/otherPage?url=http://api.relaverse.cn/index/Html/individually?id=1'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.privacy{
		position: absolute;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0,0,0,.5);
		display: flex;
		align-items: center;
		justify-content: center;
		.rect {
			width: 85%;
			background-color: #fff;
			border-radius: 20rpx;
			.link{
				text-decoration: underline;
			}
			.btn-group{
				justify-content: space-around;
			}
		}
	}
</style>
